package com.xs.shop.orders.service.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xs.shop.orders.model.entity.Payment;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author xs,zyx
 * @since 2025-07-16
 */
public interface PaymentService extends IService<Payment> {

    @Transactional(rollbackFor = Exception.class)
    Payment addPayment(Payment payment);

    @Transactional(rollbackFor = Exception.class)
    boolean deletePayment(Long id);

    @Transactional(rollbackFor = Exception.class)
    Payment updatePayment(Payment payment);

    Payment getPaymentById(Long id);

    Payment getPaymentByOrderId(Long orderId);

    /**
     * 分页查询支付记录
     * @param current 当前页
     * @param pageSize 每页条数
     * @param orderId 订单ID
     * @param orderNo 订单编号
     * @param transactionId 交易流水号
     * @return 分页结果
     */
    IPage<Payment> pagePayment(Integer current, Integer pageSize, Long orderId, String orderNo, String transactionId);
}
